home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / nntpd / man / expire.8 next >
Text File  |  1995-08-16  |  14KB  |  331 lines

  1.  
  2.  
  3.  
  4. EXPIRE(8CN)                                           EXPIRE(8CN)
  5.  
  6.  
  7. NAME
  8.        expire, doexpire, expireiflow - expire old news
  9.        upact - update news active file
  10.  
  11. SYNOPSIS
  12.        uunews:bin/expire/expire [ -a archdir ] [ -p ] [ -s ] [ -F
  13.        c ] [ -c ] [ -n nnnnn ] [ -t ] [ -l ] [ -v ] [ -d ] [ -r ]
  14.        [ -g ] [ -h ] [ -H historydir ] [ controlfile ]
  15.        uunews:bin/expire/doexpire [ expireoptions ] [ -f ] [ -e ]
  16.        uunews:bin/expire/expireiflow minimum expireoptions
  17.        uunews:bin/expire/upact [ -b ] [ -p ] [ -s ] [ -# ]
  18.  
  19. DESCRIPTION
  20.        Expire expires old news, removing it from the current-news
  21.        directories  and (if asked to) archiving it elsewhere.  It
  22.        updates news's history file to match.  Expire should  nor-
  23.        mally  be  run  nightly,  typically by using doexpire (see
  24.        below).
  25.  
  26.        Expire's operations  are  controlled  by  a  control  file
  27.        (which  can be named or supplied on standard input), which
  28.        is not optional--there is no default behavior.  Each  line
  29.        of  the  control  file  (except  for empty lines and lines
  30.        starting with `#', which are  ignored)  should  have  four
  31.        white-space-separated fields, as follows.
  32.  
  33.        The first field is a newsgroup pattern list (containing no
  34.        spaces!);  partial  specifications  are  acceptable  (e.g.
  35.        `comp'  specifies  all  groups  with  that  prefix).   See
  36.        newssys(5) for full details.
  37.  
  38.        The second field is one letter, `m', `u', or `x', specify-
  39.        ing  that  the line applies only to moderated groups, only
  40.        to unmoderated groups, or to both, respectively.
  41.  
  42.        The third field specifies the expiry period in days.   The
  43.        most  general  form  is three numbers separated by dashes.
  44.        The units are days, decimal fractions are  permitted,  and
  45.        ``never'' is shorthand for an extremely large number.  The
  46.        first number gives the retention  period:  how  long  must
  47.        pass  after  an article's arrival before it is a candidate
  48.        for expiry.  The third number gives the purge period:  how
  49.        long  must  pass  after arrival before the article will be
  50.        expired unconditionally.   The  middle  number  gives  the
  51.        expiry  period:  how long after an article's arrival it is
  52.        expired by default.  An explicit expiry date in the  arti-
  53.        cle  will override the expiry period but not the retention
  54.        period or the purge period.  If the  field  contains  only
  55.        two  numbers  with  a  dash separating them, the retention
  56.        period defaults to 0.  If the field contains only  a  num-
  57.        ber,  the  retention  period  defaults  to 0 and the purge
  58.        period defaults to `never'.  (But see below.)  The  reten-
  59.        tion  period  must  be less than the purge period, and the
  60.        expiry period must lie between them.
  61.  
  62.  
  63.  
  64.                            19 Oct 1994                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. EXPIRE(8CN)                                           EXPIRE(8CN)
  71.  
  72.  
  73.        The fourth field is an archiving directory, or  `@'  which
  74.        indicates  that  the  default archiving directory (see -a)
  75.        should be used, or `-'  which  suppresses  archiving.   An
  76.        explicit  archiving  directory (not `@') prefixed with `='
  77.        means that articles should be archived into that directory
  78.        itself;  normally  they go into subdirectories under it by
  79.        newsgroup name, as in  the  current-news  directory  tree.
  80.        (E.g.,  article  123 of comp.pc.drivel being archived into
  81.        archive   directory    /exp    would    normally    become
  82.        /exp/comp/pc/drivel/123,  but  if  the archiving directory
  83.        was given as `=/exp' rather than `/exp', it  would  become
  84.        /exp/123.)  Expire creates subdirectories under an archiv-
  85.        ing directory  automatically,  but  will  not  create  the
  86.        archiving directory itself.  Archiving directories must be
  87.        given as full pathnames.
  88.  
  89.        The first line of the control  file  which  applies  to  a
  90.        given  article  is  used  to control its expiry.  It is an
  91.        error for no line to apply; the last line should be  some-
  92.        thing like `all x 7 -' to ensure that at least one line is
  93.        always applicable.  Cross-posted articles are  treated  as
  94.        if they were independently posted to each group.
  95.  
  96.        The  retention  and  purge  defaults  can be overridden by
  97.        including a bounds line, one with the special first  field
  98.        /bounds/.   The retention and purge defaults for following
  99.        lines will be those of  the  bounds  line.   The  defaults
  100.        ``stretch''  as  necessary to ensure that the purge period
  101.        is never less than the expiry  period  and  the  retention
  102.        period is never greater than the expiry period.  The other
  103.        fields of a bounds line are ignored but must be present.
  104.  
  105.        Entries in the history file can be retained after  article
  106.        expiry,  to  stop a late-arriving copy of the article from
  107.        being taken as a new article.  To arrange this, include  a
  108.        line  with  the  special  first field /expired/; this line
  109.        then controls the expiry of history lines after the corre-
  110.        sponding  articles  expire.  Dates are still measured from
  111.        article arrival, not expiry.  The other fields of  such  a
  112.        line are ignored but must be present.  It is strongly rec-
  113.        ommended that such a line be included, and that it specify
  114.        as long a time as practical.
  115.  
  116.        Command-line options are:
  117.  
  118.        -a dir    dir  is  the  default archiving directory; if no
  119.                  default is given, the control file may not  con-
  120.                  tain any `@' archive-directory fields.
  121.  
  122.        -p        print an `index' line for each archived article,
  123.                  containing  its  pathname,  message   ID,   date
  124.                  received, and `Subject:' line.
  125.  
  126.        -s        space  is  tight;  optimize  error  recovery  to
  127.  
  128.  
  129.  
  130.                            19 Oct 1994                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. EXPIRE(8CN)                                           EXPIRE(8CN)
  137.  
  138.  
  139.                  minimize space consumed rather than to leave  as
  140.                  much evidence as possible.
  141.  
  142.        -F c      the  subfield  separator character in the middle
  143.                  history field is c rather than the normal `~'.
  144.  
  145.        -c        check the format and consistency of the  control
  146.                  file  and  the  active  file,  but do not do any
  147.                  expiring.
  148.  
  149.        -n nnnnn  set expire's idea of  the  time  to  nnnnn  (for
  150.                  testing).
  151.  
  152.        -t        print  (on  standard  error) a shell-script-like
  153.                  description of what would be done, but don't  do
  154.                  it.   In  the  absence  of archiving, all output
  155.                  lines will be of the form ``remove name'', where
  156.                  name  is  a pathname relative to uunews:.  If an
  157.                  article is to be archived, this will be preceded
  158.                  (on  the  same  line)  by  ``copy name dir ; '',
  159.                  where name is as in remove and dir is an archiv-
  160.                  ing  directory  (including  any  `='  prefix) as
  161.                  specified by the control file or the -a  option.
  162.  
  163.        -l        consider  first filename in a history line to be
  164.                  the leader of its line, to be expired only after
  165.                  all  others  have  expired.   (Meant  for use on
  166.                  obnoxious systems like VMS which  don't  support
  167.                  real links.)
  168.  
  169.        -r        suppress  history  rebuild.  Mostly for emergen-
  170.                  cies.  (This leaves the history file out of date
  171.                  and  larger  than  necessary, but improves speed
  172.                  and eliminates the need for several megabytes of
  173.                  temporary storage.)
  174.  
  175.        -h        do   not  expire  any  article  which  would  be
  176.                  archived if it were expired.  Mostly  for  emer-
  177.                  gencies,  so  that  expire can be run (to delete
  178.                  articles in non-archived groups) even  if  space
  179.                  is short in archiving areas.
  180.  
  181.        -H historydir
  182.                  the  history  file  and  its associated database
  183.                  files are in historydir rather than in  uunews:.
  184.                  (Useful  because  expire  needs to do operations
  185.                  that can't be done through symbolic links.)
  186.  
  187.        -v        verbose: report some statistics  after  termina-
  188.                  tion.
  189.  
  190.        -g        report  expiry  dates that getindate(3) does not
  191.                  like.  Expire ignores such dates,  treating  the
  192.                  article as if it had no explicit expiry date.
  193.  
  194.  
  195.  
  196.                            19 Oct 1994                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. EXPIRE(8CN)                                           EXPIRE(8CN)
  203.  
  204.  
  205.        -d        turn  on (voluminous and cryptic) debugging out-
  206.                  put.
  207.  
  208.        Expire considers the middle field of  a  history  line  to
  209.        consist  of  one  or more subfields separated by `~'.  The
  210.        first is the arrival date, which can be either  an  Inter-
  211.        net-format human-readable date or a decimal seconds count;
  212.        expire leaves this field unchanged.  The  second--if  pre-
  213.        sent,  non-null,  and  not `-'--is an explicit expiry date
  214.        for the file, again in either format,  which  expire  will
  215.        convert  to  a decimal seconds count as it regenerates the
  216.        history  file.   Subsequent  fields  are   preserved   but
  217.        ignored.
  218.  
  219.        Doexpire  checks  whether  another  doexpire  is  running,
  220.        checks that there is enough  disk  space,  invokes  expire
  221.        with  any  expireoptions given and with uunews:/explist as
  222.        the  control  file,  then  runs  upact  and   expov   (see
  223.        newsoverview(8CN)),  and reports any difficulties by send-
  224.        ing mail via report.  This is  usually  better  than  just
  225.        running  expire  directly.   If  space is not adequate for
  226.        archiving, doexpire reports this and invokes  expire  with
  227.        the  -h option.  If -r is not among the expireoptions, and
  228.        disk space is persistently inadequate for the  temporaries
  229.        needed  for  history rebuilding, doexpire reports this and
  230.        invokes expire with the -r option anyway.   -f  suppresses
  231.        this,  forcing  expire  to be run without -r regardless of
  232.        the space situation.  -e suppresses running of  upact  and
  233.        expov,  restricting  doexpire  to running expire only.  -r
  234.        implies -e.
  235.  
  236.        Expireiflow checks whether  there  are  at  least  minimum
  237.        megabytes  available  for  articles,  and invokes doexpire
  238.        with -r and the expireoptions (if any) if not.   This  may
  239.        be  useful  on systems which run close to the edge on disk
  240.        space.
  241.  
  242.        Upact updates the active file to  match  the  articles  in
  243.        uunews:  (for  various  reasons, expire does not do this).
  244.        Normally, it updates the third field, and makes  sure  the
  245.        second  field (which relaynews updates in place and cannot
  246.        expand) has a `0' on the front.  The -p option  suppresses
  247.        all  manipulation  of  the  second  field.   The -b option
  248.        causes both second and third fields to be rebuilt based on
  249.        the  articles,  for  disaster  recovery.   The  -s  option
  250.        invokes a slower but more robust version of upact's inter-
  251.        nal  machinery,  which  may be needed if the output of the
  252.        system's ls command is broken in some way.  Upact builds a
  253.        new version of the active file in active.tmp, and normally
  254.        renames this to active at the  end;  the  -#  option  sup-
  255.        presses the renaming, leaving the result in active.tmp for
  256.        debugging or inspection.
  257.  
  258.        Upact forces the third field of the active file to  be  at
  259.  
  260.  
  261.  
  262.                            19 Oct 1994                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. EXPIRE(8CN)                                           EXPIRE(8CN)
  269.  
  270.  
  271.        least  five digits, for backward compatibility, but other-
  272.        wise just makes it as large as necessary.  This  field  is
  273.        never updated in place, so extending it to a larger number
  274.        of digits is unnecessary.
  275.  
  276.        The new implementation of upact supersedes the old  recov-
  277.        act  and  updatemin  commands, and is much faster than the
  278.        old upact.
  279.  
  280. FILES
  281.        uunews:/history         history file
  282.        uunews:/history.pag     dbm database for history file
  283.        uunews:/history.dir     dbm database for history file
  284.        uunews:/explist         expiry control file
  285.        uunews:/history.o       history file as of last expiry
  286.        uunews:/history.n*      new history file and dbm files abuilding
  287.        uunews:/LOCKexpire      doexpire's lock file
  288.  
  289. SEE ALSO
  290.        inews(1CN), dbm(3), newssys(5), relaynews(8CN)
  291.  
  292. HISTORY
  293.        Written at U of Toronto by Henry Spencer,  with  contribu-
  294.        tions  by  Geoff Collyer.  The idea for the fast algorithm
  295.        in upact came  from  Bernd  Felsche  of  MetaPro  Systems,
  296.        although the final code is rather different from his.
  297.  
  298. BUGS
  299.        Archiving  is  always  done  by copying, never by linking.
  300.        This has the side effect that  cross-posted  articles  are
  301.        archived as several independent copies.
  302.  
  303.        The  -p  subject-finder  botches  continued  header lines,
  304.        although such lines are rare.
  305.  
  306.        One cannot put more  than  one  newsgroup  into  a  single
  307.        archiving  directory with the `=' feature, since the arti-
  308.        cle numbers  will  collide  with  each  other  and  expire
  309.        doesn't  do  anything  about  this.  Note that archiving a
  310.        newsgroup which has subgroups into an `='  directory  puts
  311.        all  the  subgroups  in  the same directory as the parent!
  312.        (Specifying the group as `foo.bar,!foo.bar.all' will avoid
  313.        this.)
  314.  
  315.        Expire  uses access(2) to test for the presence of archiv-
  316.        ing directories, which can cause anomalies if  it  is  run
  317.        setuid (normally it's not).
  318.  
  319.        Expire  startup time is proportional to the product of the
  320.        number of entries in the control file and  the  number  of
  321.        lines  in  active.  It can be significant for complex con-
  322.        trol files.
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                            19 Oct 1994                          5
  329.  
  330.  
  331.